//
//  ViewController00.swift
//  BankOfChina
//
//  Created by mac on 2023/11/19.
//

import UIKit

class ViewController00: UIViewController {

    @IBOutlet weak var bgImageView: UIImageView!
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.isNavigationBarHidden = true
    }
    override var preferredStatusBarStyle: UIStatusBarStyle {
      return .lightContent
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */
    
    override func viewWillDisappear(_ animated: Bool) {
        super.viewWillDisappear(animated)
        let xx = UserDefaults.standard.object(forKey: "login")
        if (xx == nil){
            self.bgImageView.image = UIImage(named: "00")
        }else{
            self.bgImageView.image = UIImage(named: "000")
        }
    }
    @IBAction func push00(_ sender: Any) {
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let vc11 = storyboard.instantiateViewController(withIdentifier: "ViewController11")
        self.navigationController?.pushViewController(vc11, animated: true)
    }
    
    @IBAction func push11(_ sender: Any) {
        let xx = UserDefaults.standard.object(forKey: "login")
        if (xx == nil){
            let storyboard = UIStoryboard(name: "Main", bundle: nil)
            let vc11 = storyboard.instantiateViewController(withIdentifier: "ViewController11")
            self.navigationController?.pushViewController(vc11, animated: true)
        }else{
            let storyboard = UIStoryboard(name: "Main", bundle: nil)
            let vc22 = storyboard.instantiateViewController(withIdentifier: "ViewController22")
            self.navigationController?.pushViewController(vc22, animated: true)
        }
    }
}
